import {customeStruct} from '../utils';
const itf = customeStruct.interface;

export const InitDataStruct = itf({
    payload: itf({
        isDealerUser: 'boolean? | null',
        brands: [itf({
            id: 'string',
            code: 'string',
            name: 'string',
        })],
    })
});

const content = {
    id: 'string',
    code: 'string',
    brandCode: 'string? | null',
    brandName: 'string? | null',
    name: 'string? | null',
    status: 'number? | null',
    options: ['string'],
};

export const List = itf({
    payload: itf({
        content: [itf(Object.assign(content))]
    })
});

export const Detail = itf({
    payload: itf({
        id: 'string',
        code: 'string',
        brandCode: 'string? | null',
        name: 'string? | null',
        rowVersion: 'string? | null',
        options: ['string'],
        details: [
            itf({
                personnelId: 'string',
                personnelName: 'string'
            })
        ]
    })
});
export const Personnel = itf({
    payload: itf({
        content: [
            itf(Object.assign({
                id: 'string',
                name: 'string',
                userName: 'string? | null'
            }))
        ]
    })
});
